package com.lin.service.chats;

import com.lin.common.error.CustomRuntimeException;
import com.lin.controller.req.ChatsDetailReqMsg;
import com.lin.controller.res.ChatPageResMsg;
import com.lin.controller.res.CustomerChatPageResMsg;
import com.lin.socketio.dto.ChatObject;

import java.io.IOException;

public interface ChatsService {

    CustomerChatPageResMsg chatlist(Long id, int pageSize, int pageNo);

    ChatPageResMsg byCustomerId(Long id, int pageSize, int pageNo);

    /**
     * 目前调用的是通过Rabbitmq对应的各个消费者进行消费，这样如果直接存储，肯定会出现存储多个同样的记录，故需要先查询，如果有则不存储，否则存储。
     * @param data
     * @return
     * @throws CustomRuntimeException
     * @throws IOException
     */
    Integer save(ChatObject data) throws CustomRuntimeException, IOException;

    Integer updateReadFlag(ChatObject data);

    ChatPageResMsg chatdetail(ChatsDetailReqMsg reqMsg);
}
